package com.yc.springclouduser.web;

import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("user")
public class UserAction {

    @RequestMapping("user")
    public String user(@RequestHeader(value = "Truth",required = false) String truth,
                       HttpServletRequest request){
        System.out.println("truth: " + truth);
        int port = request.getServerPort();
        return "user"+ port;
    }
}
